package no.hio.wsprovider.dao;

import java.util.List;
import java.util.NoSuchElementException;

import no.hio.wsprovider.vo.StockItem;

/**
 * DataAccessObject for StockItem.
 * @version 1.0
 * @see StockItem
 * @author Andreas Heim and Henning Gundersen 
 *
 */
public interface StockItemDAO 
{
	/**
	 * Returns all stockItems.
	 * @return List with all stock items.
	 */
	public List<StockItem> findAll();
	
	/**
	 * 
	 * Returns one matching stock item given the products ID
	 * 
	 * @param productID 
	 * @return Product with given ID
	 */
	public StockItem findByProductID(int productID);
	
	/**
	 * Commits changes to the datasource. 
	 * @param stockItem StockItem to be saved
	 */
	public void insert(StockItem stockItem)throws UnsupportedOperationException;
	
	/**
	 * Updates object with values from datasource.
	 * @param stockItem StockItem to be updated
	 */
	public void update(StockItem stockItem);
	
	/**
	 * Removes product from datasource
	 * @param stockItem StockItem to be removed.
	 */
	public void remove(StockItem stockItem) throws NoSuchElementException;

	
}
